export const barOptions = (yAxis, series) => {
  return {
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'shadow'
			}
		},
    color: ['#91cd76'],
		legend: {
			data: ['Top 5 best-selling Items']
		},
		grid: {
      top: 30,
			left: '3%',
			right: '10%',
			bottom: '3%',
			containLabel: true
		},
		xAxis: {
			type: 'value'
		},
		yAxis: {
			type: 'category',
			data: yAxis
		},
		series: [
			{
				name: 'Top 5 best-selling Items',
				type: 'bar',
				data: series
			}
		]
	}
}

export const barOptions2 = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  color: ['#409eff'],
  legend: {
    data: ['Customer Number']
  },
  grid: {
    top: 30,
    left: '3%',
    right: '10%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    type: 'value',
  },
  yAxis: {
    type: 'category',
    data: ['Jeff', 'John', 'Catd', 'David', 'Eva']
  },
  series: [
    {
      name: 'Customer Number',
      type: 'bar',
      data: [30, 26, 25, 20, 20]
    }
  ]
}

export const pieOption = (data) => {
  return {
    title: {
      text: 'Sampled Items Top 5' ,
      top: "bottom",
      left: "center"
    },
    tooltip: {
      trigger: 'item'
    },
    legend: {
      top: '5%',
      // left: 'center'
    },
    series: [
      {
        top: 50,
        name: 'Sampled Items Top 5',
        type: 'pie',
        radius: ['40%', '70%'],
        avoidLabelOverlap: false,
        label: {
          show: false,
          position: 'center'
        },
        emphasis: {
          label: {
            show: true,
            fontSize: '12'
          }
        },
        labelLine: {
          show: false
        },
        data
      }
    ]
  }
}